package com.twu.biblioteca;

public class User {
    private String username;
    private String password;
    private String name;
    private String email;
    private int phoneNum;

    public User(String username, String password)
    {
        this.username = username;
        this.password = password;
    }

    public String getUsername() {
        return username;
    }

    public String getPassword() {
        return password;
    }

    public boolean isValidPassword(String password) {
        return password.equals(this.password);
    }

    @Override
    public String toString()
    {
        String toReturn = username;
        return toReturn.substring(0,3) + "-" + toReturn.substring(3);
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public void setPhoneNum(int phoneNum) {
        this.phoneNum = phoneNum;
    }

    public String printDetails() {
        return name + ": <" + email + ">, Phone number: " + phoneNum;
    }
}
